<th:block
        th:with='postItems=${posts.items},
          postRandomImg=${#strings.contains(theme.config.layout.postRandomImg,"?") ? theme.config.layout.postRandomImg+"&" : theme.config.layout.postRandomImg+"?"}'>
    
    <!-- card，需要添加在没有图片时使用随机图片 -->
    <div class="recent-post-item article-item"
         th:classappend="${theme.config.layout.post.cols} + ' ' +
         ${theme.config.layout.post.postLocation} + ' ' +
         (${iStat.even} ? 'even' : 'odd') + ' ' +
         (${post.spec.pinned} ? 'pinned-post-item' : '')"
         th:attr="onclick='pjax.loadUrl(\''+ @{${post.status.permalink}} +'\')'"
         th:each="post,iStat : ${postItems}">
        
        <!-- 文章缩略图 -->
        <div class="post_cover article-cover">
            <a th:attr="title=${post.spec.title}" th:href="@{${post.status.permalink}}">
                <img class="post_bg cover"
                     th:with='img = ${#strings.isEmpty(post.spec.cover) ? postRandomImg+post.spec.title : thumbnail.gen(post.spec.cover, "m")}'
                     th:alt="${post.spec.title}"
                     th:data-lazy-src="${ isLazyload ? img : ''}"
                     th:src="${isLazyload ? loadingImg : img}">
            </a>
        </div>
        
        <!-- 文章信息 -->
        <div class="recent-post-info article-info">
            <!-- 顶部元信息 -->
            <div class="article-meta">
                <!-- 置顶 -->
                <span class="top" th:if="${post.spec.pinned}">
                    <i class="haofont hao-icon-zhiding"></i>置顶
                </span>
                <!-- 发表时间 -->
                <span class="meta-item ml-3-75" th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}">
                    <i class="far fa-calendar-alt"></i>
                    <time th:datetime="${post.spec.publishTime}"
                          th:if="${days > 30}"
                          th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}">
                    </time>
                    <time th:datetime="${post.spec.publishTime}"
                          th:if="${days <= 30 && days > 0}"
                          th:text="${days}+'天前'">
                    </time>
                    <time th:datetime="${post.spec.publishTime}"
                          th:if="${days == 0}"
                          th:text="'最近'">
                    </time>
                </span>
                <!-- 文章标签 -->
                <th:block th:if="${not #lists.isEmpty(post.tags)}">
                    <a class="meta-item ml-3-75" th:each="tag : ${post.tags}" 
                       th:href="@{${tag.status.permalink}}" 
                       th:title="${tag.spec.displayName}">
                        <i class="haofont hao-icon-tag"></i>
                        <span th:text="${tag.spec.displayName}"></span>
                    </a>
                </th:block>
            </div>
            
            <!-- 文章标题 -->
            <h3 class="article-title">
                <a th:href="@{${post.status.permalink}}" th:text="${post.spec.title}"></a>
            </h3>
            
            <!-- 文章摘要内容 -->
            <div class="article-content" th:text="${
    #strings.contains(post.status.excerpt, '总结') ? 
        (#strings.length(#strings.trim(#strings.substringAfter(post.status.excerpt, '总结'))) > 150 ? 
            #strings.substring(#strings.trim(#strings.substringAfter(post.status.excerpt, '总结')), 0, 150) + '...' : 
            #strings.trim(#strings.substringAfter(post.status.excerpt, '总结'))
        ) : 
    #strings.contains(post.status.excerpt, '小结') ? 
        (#strings.length(#strings.trim(#strings.substringAfter(post.status.excerpt, '小结'))) > 150 ? 
            #strings.substring(#strings.trim(#strings.substringAfter(post.status.excerpt, '小结')), 0, 150) + '...' : 
            #strings.trim(#strings.substringAfter(post.status.excerpt, '小结'))
        ) :
    #strings.contains(post.status.excerpt, 'Summary') ? 
        (#strings.length(#strings.trim(#strings.substringAfter(post.status.excerpt, 'Summary'))) > 150 ? 
            #strings.substring(#strings.trim(#strings.substringAfter(post.status.excerpt, 'Summary')), 0, 150) + '...' : 
            #strings.trim(#strings.substringAfter(post.status.excerpt, 'Summary'))
        ) :
        (#strings.length(post.status.excerpt) > 150 ? 
            #strings.substring(post.status.excerpt, 0, 150) + '...' : 
            post.status.excerpt
        )
}"></div>
            
            <!-- 文章分类 -->
            <th:block th:if="${not #lists.isEmpty(post.categories)}">
                <div class="article-category">
                    <i class="haofont hao-icon-qizhi"></i>
                    <a th:href="@{${post.categories.get(0).status.permalink}}" 
                       th:text="${post.categories.get(0).spec.displayName}"></a>
                </div>
            </th:block>
        </div>
        
        <!-- 文章卡片擦亮效果 -->
        <style th:if="${theme.config.layout.articleCardPolish}">
            #recent-posts > .recent-post-item:not(a)::before {
                content: "";
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 200%;
                background: linear-gradient(to right, transparent, white, transparent);
                transform: translateX(-200%);
                transition: transform 0.5s linear;
                z-index: 1;
            }
            
            #recent-posts > .recent-post-item:not(a):hover::before {
                transform: translateX(100%) skewX(-60deg);
            }
        </style>
    </div>
    
    <!-- 分页 -->
    <div th:replace="~{modules/widgets/page :: page('',${posts},true,'')}"></div>

</th:block>